/**
 * Licensee: avaj llik
 * License Type: Purchased
 */
package ormsamples;

import org.orm.*;
public class DeleteTallerdeSOAData {
	public void deleteTestData() throws PersistentException {
		PersistentTransaction t = orm.TallerdeSOAPersistentManager.instance().getSession().beginTransaction();
		try {
			orm.DAOFactory lDAOFactory = orm.DAOFactory.getDAOFactory();
			orm.dao.Tcp_publicacionDAO lormTcp_publicacionDAO = lDAOFactory.getTcp_publicacionDAO();
			orm.Tcp_publicacion lormTcp_publicacion = lormTcp_publicacionDAO.loadTcp_publicacionByQuery(null, null);
			// Delete the persistent object
			lormTcp_publicacionDAO.delete(lormTcp_publicacion);
			orm.dao.Tcp_personaDAO lormTcp_personaDAO = lDAOFactory.getTcp_personaDAO();
			orm.Tcp_persona lormTcp_persona = lormTcp_personaDAO.loadTcp_personaByQuery(null, null);
			// Delete the persistent object
			lormTcp_personaDAO.delete(lormTcp_persona);
			t.commit();
		}
		catch (Exception e) {
			t.rollback();
		}
		
	}
	
	public static void main(String[] args) {
		try {
			DeleteTallerdeSOAData deleteTallerdeSOAData = new DeleteTallerdeSOAData();
			try {
				deleteTallerdeSOAData.deleteTestData();
			}
			finally {
				orm.TallerdeSOAPersistentManager.instance().disposePersistentManager();
			}
		}
		catch (Exception e) {
			e.printStackTrace();
		}
	}
}
